package com.project.common;

public class RestResponse {

	int resultCode;
	String resultMsg;
	Object data;

	public RestResponse() {
	}

	public RestResponse(int resultcode, String resultmsg, Object data) {
		super();
		this.resultCode = resultcode;
		this.resultMsg = resultmsg;
		this.data = data;
	}
	
	public static RestResponse success(){
		return new RestResponse(200,"success",null);
	}
	
	public static RestResponse success(Object data){
		return new RestResponse(200,"success",data);
	}
	
	public static RestResponse fail(String msg){
		return new RestResponse(500,msg,null);
	}

	public int getResultCode() {
		return resultCode;
	}

	public void setResultCode(int resultCode) {
		this.resultCode = resultCode;
	}

	public String getResultMsg() {
		return resultMsg;
	}

	public void setResultMsg(String resultMsg) {
		this.resultMsg = resultMsg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	@Override
	public String toString() {
		return "JsonBean [resultcode=" + resultCode + ", resultmsg=" + resultMsg + ", data=" + data + "]";
	}

}
